package com.chendongyang.www.controller;
import com.chendongyang.www.service.*;
import com.chendongyang.www.service.reservation;
import java.util.Scanner;
public class controller {
    public static void main(String[] args) throws Exception {
        int Judge = 0;
        boolean Jude1=false;
        add option4 = new add();
        charges option1 = new charges();
        apprise option8 = new apprise();
        stops option2 = new stops();
        reservation option6 = new reservation();
        application option5 = new application();
        managerlogin option3 = new managerlogin();
        add option7 = new add();
        longstanding option = new longstanding();
        Scanner input = new Scanner(System.in);
        System.out.println("===========================");
        System.out.println("欢迎来到校园电动车管理系统");
        System.out.println("请先进行登录或注册");
        System.out.println("1  注册并登录");
        System.out.println("2  登录");
        System.out.println("3  管理员登录");
        System.out.println("============================");
        int op = input.nextInt();
        switch (op) {
            case 1:
                Judge = option.register();
                break;
            case 2:
                Judge = option.logIn();
                break;
            case 3:
                Jude1=option3.logIn();
                break;
        }
        for (; ; ) {
            if (op - 2 <= 0 && Judge == 1) {
                System.out.println("亲爱的用户您好，现有以下功能");
                System.out.println("1  完善电动车信息");
                System.out.println("2  充电选择");
                System.out.println("3  停车选择");
                System.out.println("4  车辆上牌");
                System.out.println("5  充电预约");
                System.out.println("6  停车预约");
                System.out.println("7  充电口体验评论");
                System.out.println("8  结束退出");
                System.out.println("请输入对应数字:");
                int op1 = input.nextInt();
                switch (op1) {
                    case 1:
                        option.improve();
                        break;
                    case 2:
                        option1.charging();
                        break;
                    case 3:
                        option2.stoping();
                        break;
                    case 4:
                        option5.apply();
                        break;
                    case 5:
                        option6.reservating();
                        break;
                    case 6:
                        option6.reservating1();
                        break;
                    case 7:
                        option8.apprising();
                        break;
                }
                if(op1==8) break;
            } else if (op == 3&&Jude1) {
                System.out.println("==================");
                System.out.println("亲爱的管理员您好");
                System.out.println("您有以下功能：");
                System.out.println("1     充电位的增加或删除");
                System.out.println("2     停车位的增加或删除");
                System.out.println("3     查看现有充电位和停车位");
                System.out.println("4     用户车牌申请审核");
                System.out.println("5     添加充电预约时间段");
                System.out.println("6     添加停车位的预约时间段 ");
                System.out.println("7     结束退出");
                System.out.println("请输入对应选项");
                int op4 = input.nextInt();
                switch (op4) {
                    case 1:
                        option4.adding();
                        break;
                    case 2:
                        option4.adding1();
                        break;
                    case 4:
                        option5.check();
                        break;
                    case 5:
                        option7.adding2();
                        break;
                    case 6:
                        option7.adding3();
                        break;
                }
                if(op4==7) break;
            }
        }
    }
}